package guda.house.biz.form.village;

import guda.house.dal.dataobject.EstateDO;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


public class EstateForm {

    @Size(min=1,max=20,message = "长度为1到20个字符")
    private String estateName;
    @Size(min=2,max=5,message = "长度为2到5个字符")
    private String contactUser;
    @Pattern(regexp = "^[1][345789][0-9]{9}$",message = "手机号格式不正确")
    private String contactPhone;


    public EstateDO toDO() {
        EstateDO estateDO = new EstateDO();
        estateDO.setContactPhone(contactPhone);
        estateDO.setContactUser(contactUser);
        estateDO.setEstateName(estateName);
        return estateDO;
    }

    public String getEstateName() {
        return estateName;
    }

    public void setEstateName(String estateName) {
        this.estateName = estateName;
    }

    public String getContactUser() {
        return contactUser;
    }

    public void setContactUser(String contactUser) {
        this.contactUser = contactUser;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }
}
